package com.ruoyi.web.controller.teacher;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.BasisEvent;
import com.ruoyi.domain.Basislabel;
import com.ruoyi.service.BasisLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author yichaofan
 * date 2025/5/27
 */
@RestController
@RequestMapping("/label")
public class BasisLabelController extends BaseController {

    @Autowired
    BasisLabelService labelService;
    /**
     * 插入信息
     * @param
     */
    @GetMapping("/list")
    public TableDataInfo list(Basislabel basislabel)
    {
        startPage();
        List<Basislabel> basislabels = labelService.selectLabelList(basislabel);
        return getDataTable(basislabels);
    }
    /**
     * 插入信息
     * @param label
     */
    @PostMapping("/insertLabel")
    public R<Long> insertLabel(Basislabel label)
    {
        labelService.isnertLabel(label);
        return R.ok(label.getId());
    }
    @PostMapping("/updateLabel")
    public R updateLabel(Basislabel label)
    {
        labelService.updateLabel(label);
        return R.ok();
    }
    @PostMapping("/{ids}")
    public R deleteLabel(@PathVariable Long[] ids)
    {
        labelService.deleteLabelByIds(ids);
        return R.ok();
    }

}
